<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="dist/css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all">
<link rel="stylesheet" href="dist/css/datepicker.css">

<script src="dist/js/jquery-1.9.1.min.js"></script>
<script src="dist/js/jquery.validate.min.js"></script>
<script src="dist/js/holiday-validation.js"></script>
<script src="dist/js/holiday.js"></script>

<title>Holiday</title>
</head>
<body>
<div id="logged"></div>
	<div class="container" style="height: 410px" id="editHoliday">
		<table>
			<tr>
				<td valign="top">
					<div>
						<form action="addHoliday.action" name="addHoliday" id="holidayForm">
							<table align="left">
								<tr>
									<td><h4>Select Date :</h4></td>
									<td><input type="text" class="form-control" name="date"
										placeholder="Select Date" id="datepicker"></td>
										<td><label class="error" for="datepicker"
									style="color: red" generated="true"></label></td>
								</tr>
								<tr>
									<td>
										<h4>Enter Description :</h4>
									</td>
									<td><input type="text" id="description" name="description"
										class="form-control" placeholder="Enter Description">
									</td>
									<td><label class="error" for="description"
									style="color: red" generated="true"></label></td>
								</tr>
								<tr>
									<td></td>
									<td>
										<button class="btn btn-lg btn-primary btn-block" type="button"
											id="submit" onclick="addholidayDetails()">Add</button>
									</td>
								</tr>
							</table>
						</form>
					</div>
				</td>
			</tr>
		</table>
	</div>
</body>
<script src="dist/js/bootstrap-datepicker.js"></script>
<script type="text/javascript">
	// When the document is ready
	$(document).ready(function() {

		$('#datepicker').datepicker({
			format : "dd/mm/yyyy",
		});
		$("#datepicker").keydown(false);
		$('#datepicker').bind("contextmenu", function(e) {
			e.preventDefault();
		});
		
		$('#datepicker').on('changeDate', function(ev){
		    $(this).datepicker('hide');
		});
	});

	$(function() {
		$("#addHoliday").validate({
			rules : {
				date : "required",
				description : "required",
			},
			// Specify the validation error messages
			messages : {
				date : "Please select date",
				description : "Please enter holiday description",
			},
			submitHandler : function(form) {
				form.submit();
			}
		});
	});

	
</script>
</html>